home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / modules / C-Header_Old < prev    next >
Text File  |  1994-04-04  |  2KB  |  80 lines

  1. #include <libraries/mui.h>
  2. #include <proto/muimaster.h>
  3. #include <clib/exec_protos.h>
  4. #include <clib/alib_protos.h>
  5. #include <exec/memory.h>
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8.  
  9. #ifndef MAKE_ID
  10. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  11. #endif
  12.  
  13. #ifdef _DCC
  14. #define __inline
  15. #endif
  16.  
  17. struct Library *MUIMasterBase, *LocaleBase;
  18.  
  19. /*************************/
  20. /*    Fail Function      */
  21. /*************************/
  22.  
  23. static VOID fail(APTR app,char *str)
  24. {
  25.         if (app)
  26.                 MUI_DisposeObject(app);
  27.  
  28. #ifndef _DCC
  29.         if (MUIMasterBase)
  30.                 CloseLibrary(MUIMasterBase);
  31. #endif
  32.     if (str)
  33.         {
  34.                 puts(str);
  35.                 exit(20);
  36.         }
  37.         exit(0);
  38. }
  39.  
  40. /*************************/
  41. /*    Init Function      */
  42. /*************************/
  43.  
  44. static VOID init(VOID)
  45. {
  46. #ifdef _DCC
  47.         onbreak(brkfunc);
  48. #endif
  49.  
  50. #ifndef _DCC
  51.         if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  52.                 fail(NULL,"Failed to open "MUIMASTER_NAME".");
  53. #endif
  54. }
  55.  
  56. /*************************/
  57. /* InitLocale Function   */
  58. /*************************/
  59.  
  60. static VOID initlocale(VOID)
  61. {
  62. #ifndef _DCC
  63.         LocaleBase = OpenLibrary("Locale.library",38L);
  64. #endif
  65.     /* YOU MUST write this function !!! */
  66.         /* OpenCatalog(NULL,NULL); */
  67. }
  68.  
  69. /****************************************************************/
  70. /*      ExTended KeyButton ( or Eric Totel KeyButton :-) )      */
  71. /*      to use with localization features                       */
  72. /****************************************************************/
  73.  
  74. static APTR __inline ETKeyButton(char *text)
  75. {
  76.         return (KeyButton(&text[3], text[1]));
  77. }
  78.  
  79.  
  80.